package com.hxkj.dao.impl;

import com.hxkj.dao.FunctionLibraryDao;
import com.hxkj.domain.po.AuthFunction;
import com.hxkj.domain.po.FunctionLibraryTree;
import com.hxkj.mapper.FunctionLibraryMapper;
import com.hxkj.domain.po.FunctionLibrary;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;


/**
* 数据操作实现
*
* @author: chenwei
* @version: 1.0
* @datetime: 2018-06-27 12:35:00
*
*/
@Service("functionLibraryDao")
public class FunctionLibraryDaoImpl implements FunctionLibraryDao {

    @Resource
    private FunctionLibraryMapper functionLibraryMapper;

    @Override
    public FunctionLibrary get(Long id) {
        return functionLibraryMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<FunctionLibrary> get(FunctionLibrary functionLibrary) {
        return functionLibraryMapper.select(functionLibrary);
    }

    @Override
    public int delete(Long id) {
        return functionLibraryMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int delete(FunctionLibrary functionLibrary) {
        return functionLibraryMapper.delete(functionLibrary);
    }

    @Override
    public int save(FunctionLibrary functionLibrary) {
        return functionLibraryMapper.insert(functionLibrary);
    }

    @Override
    public int update(FunctionLibrary functionLibrary) {
        return functionLibraryMapper.update(functionLibrary);
    }

    @Override
    public List<FunctionLibrary> getFunctionLibrarieList(FunctionLibrary functionLibrary) {
        return functionLibraryMapper.getFunctionLibrarieList(functionLibrary);
    }

    @Override
    public int saveFunctionLibrary(FunctionLibrary functionLibrary) {
        functionLibrary.setCreateTime(System.currentTimeMillis());
        functionLibrary.setUpdateTime(System.currentTimeMillis());
        return functionLibraryMapper.saveFunctionLibrary(functionLibrary);
    }

    @Override
    public int modifyFunctionLibrary(FunctionLibrary functionLibrary) {
        functionLibrary.setUpdateTime(System.currentTimeMillis());
        return functionLibraryMapper.modifyFunctionLibrary(functionLibrary);
    }

    @Override
    public int removeFunctionLibrary(FunctionLibrary functionLibrary) {
        return functionLibraryMapper.removeFunctionLibrary(functionLibrary);
    }

    @Override
    public List<FunctionLibrary> getShowFunctionLibrarieList(FunctionLibrary functionLibrary) {
        return functionLibraryMapper.getShowFunctionLibrarieList(functionLibrary);
    }

    @Override
    public FunctionLibrary getFunctionLibrary(FunctionLibrary functionLibrary) {
        return functionLibraryMapper.getFunctionLibrary(functionLibrary);
    }

    @Override
    public Long saveFunction(AuthFunction authFunction) {
        return functionLibraryMapper.saveFunction(authFunction);
    }

    @Override
    public List<FunctionLibrary> getFunctionLibraryList(FunctionLibrary functionLibrary) {
        return functionLibraryMapper.getFunctionLibraryList(functionLibrary);
    }

    @Override
    public int countFunctionLibrarieByParentId(Long parentFunctionId) {
        return functionLibraryMapper.countFunctionLibrarieByParentId(parentFunctionId);
    }

    @Override
    public int modifyFunctionLibraryStatus(FunctionLibrary functionLibrary) {
        return functionLibraryMapper.modifyFunctionLibraryStatus(functionLibrary);
    }

    @Override
    public FunctionLibrary getFunctionLibraryById(Long id) {
        return functionLibraryMapper.getFunctionLibraryById(id);
    }

    @Override
    public List<FunctionLibrary> getShowFunctionLibrarieIdList(FunctionLibrary functionLibrary) {
        return functionLibraryMapper.getShowFunctionLibrarieIdList(functionLibrary);
    }
}
